home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / LZAPI.ZIP / SIMPLE.ZIP / SIMPLE.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1995-04-19  |  1.8 KB  |  50 lines

  1. { --------------------------------------------------------------------
  2.  |        S I M P L E . P A S
  3.  |
  4.  | This is a Simple Pascal-Based Demonstration-Program for LZAPI
  5.  |
  6.  | It will simply copy all you INI-Files into an Archiv in the Temp
  7.  | Directory
  8.  | Bernd Herd 23.3.1995
  9.  ---------------------------------------------------------------------- }
  10.  
  11. Program Simple;
  12.  
  13. uses LZAPI, WinProcs, WinTypes, Strings;
  14.  
  15.  
  16. var Ctl              : LACTL;                   { Define the Control Strcture }
  17.     WindowsDirectory : Array[0..144] of char;   { Windows-Directory with our INI-Files }
  18.     TempDirectory    : Array[0..144] of char;   { Directory for Temp-Files }
  19.     p                : Pchar;
  20.     dummy            : TOFSTRUCT;               { For OpenFile }
  21.     err              : LAERR;                   { LZAPI Error Code }
  22.  
  23. Begin
  24.   { ------ Windows Directory ------------------------ }
  25.   GetWindowsDirectory( WindowsDirectory, sizeof(WindowsDirectory) );
  26.  
  27.   { ------ Temp-Directory --------------------------- }
  28.   GetTempFileName(#0, 'LZH', 0, TempDirectory);
  29.   OpenFile( TempDirectory, dummy, OF_DELETE);
  30.   strRscan(TempDirectory, '\')[1] := #0;
  31.   strCat  (TempDirectory, 'INIS.LZH');
  32.  
  33.   { ------ Fill Control structure ------------------- }
  34.   FillChar( Ctl, sizeof(Ctl), 0);
  35. {  Ctl.hwndOwner       := ; This Program does not open a Window... normaly you MUST support this! }
  36.   Ctl.lStructSize     := sizeof( Ctl );
  37.   Ctl.lpstrArchivFile := TempDirectory;
  38.   Ctl.lpstrWildcards  := '*.INI';
  39.   Ctl.lpstrPath       := WindowsDirectory;
  40.   Ctl.Flags           := LAF_SHORTNAMES;
  41.  
  42.   { ------ Perform Actions -------------------------- }
  43.   err := LAAppend( @Ctl );
  44.   if (err <> LAE_OK)
  45.       then LAErrMsg(err, @Ctl )
  46.       else MessageBox( 0, 'Hi, this was your Success for Today ;-)', 'SIMPLE.PAS', MB_OK or MB_ICONINFORMATION);
  47.  
  48.  
  49. End.
  50.